package com.qianfeng.smartdevice.controller;

import com.qianfeng.smartdevice.dto.HumtempEcharts;
import com.qianfeng.smartdevice.dto.R;
import com.qianfeng.smartdevice.service.IHumitureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//基于 JVM 的语言
@RequestMapping("/humitures")
@RestController
public class HumitureController {
    private IHumitureService humitureService;
    @Autowired
    public void setHumitureService(IHumitureService humitureService) {
        this.humitureService = humitureService;
    }

    @GetMapping("/humitures")
    public R getHumitures() {
        HumtempEcharts humtempEcharts = humitureService.getHumitures();
        return R.setOk(humtempEcharts);
    }
}
